﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class TestDemo
    {
        private string _name = string.Empty;

        public string Name
        {
            get
            {
                return (_name != null) ? _name : string.Empty;
            }
            set { _name = value; }
        }

        private string _pwd = string.Empty;

        public string Pwd
        {
            get { return _pwd; }
            set { _pwd = value; }
        }

        public override string ToString()
        {
            return "姓名:" + this.Name + "  密码:" + this.Pwd;
        }

        //一般情况下，创建了字段，都需要给出构造函数
        public TestDemo()
        {

        }

        public TestDemo(string userName, string userPwd)
        {
            this.Name = userName;
            this.Pwd = userPwd;
        }
    }
}
